package DataBase;

import junit.framework.TestCase;
/**
* Description : Test for MenuTag_File
* <p>
*
*@author Danielle
*/
public class MenuTag_FileTest extends TestCase {
	MenuTag_File menuForTags;
	
	/**
	* Description initAll- menuForTags
	*/
	public void initAll()
	{
		menuForTags=new MenuTag_File();
		menuForTags.deleteDB();
	}
	
	/**
	* Description show 
	* @param String[] str
	*/
	public void show(String[] str)
	{
		int i,size=str.length;
		for (i=0; i<size; i++)
		{
			System.out.println(str[i]);
		}
	}
	
	/**
	* Description Test 1: addFile , getFiles
	* @throws Exception
	*/
	public void testSource1() throws Exception  {
		initAll();
		menuForTags.addFile("C:\\test.doc");
		menuForTags.addFile("C:\\test2.doc");
		show(menuForTags.getFiles());

	}
	
	/**
	* Description Test 2: addTag and getTags
	* @throws Exception
	*/
	public void testSource2() throws Exception  {
		initAll();
		menuForTags.addTag("Tag1");
		menuForTags.addTag("Tag2");
		show(menuForTags.getTags());
	}
	
	/**
	* Description Test 3: addFile, addTag, ConnectTag_File, AllTagsOfFile, AllFilesInTag
	* @throws Exception
	*/
	public void testSource3() throws Exception  {
		initAll();
		menuForTags.addFile("C:\\test.doc");
		menuForTags.addFile("C:\\test2.doc");
		menuForTags.addTag("Tag1");
		menuForTags.addTag("Tag2");
		menuForTags.ConnectTag_File("new", "Tag1");
		menuForTags.ConnectTag_File("new", "Tag2");
		menuForTags.ConnectTag_File("C:\\test2.doc", "Tag2");
		menuForTags.ConnectTag_File("C:\\test.doc", "Tag2");
		System.out.println("AllTags Of : "+"new");
		show(menuForTags.AllTagsOfFile("new"));
		System.out.println("All Files Of : "+"Tag2");
		show(menuForTags.AllFilesInTag("Tag2"));
	}
	

}
